package com.hb.trade.api.routine.config.pay;

import cn.hutool.extra.spring.SpringUtil;

/**
 * 关于支付宝的支付配置
 * 1, 开放平台开放相关的支付能力
 * 2, 需要签约的签约
 * 3, 只用支付宝提供的开放平台开发助手工具生成一对RSA2格式的公钥私钥, 这里的公钥私钥被称为应用公钥和应用私钥
 * 4, 将应用公钥上传到支付宝的开放平台, 会绑定APPID并生成一个支付宝公钥
 * 5, 支付时使用支付宝公钥
 * 6, 当面付功能和电脑网站支付功能互斥
 *
 * @author zhaojk
 */
public class AliPayConfig {

    // 多多中标
//    public static String APPID = "2021001189663858";
    // 私钥 pkcs8格式的(多多中标)
//    public static String RSA_PRIVATE_KEY = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCZ+5LrdmGt/jHoq/xi8iUWs9maKccSyJYaHdn4DJOS7cBD/K//7fXNnrbp+xQFzM5sfnC8jTPVLk4L2mYuc6lNiRvnOy9mFQM/tvXyuFhsTXU9cJ3p/EiOkEWMBn2q/hZ2lKjtcZdgG+fLSeQneKBGeOWzqikZ0bjoUc/3iXr913S6NDS9Rq/b+fiDxA5YmG4esFJ1UaRKH4W3iR1VPAsXpvSy3BxO1dGwuHqXYFhMUe5A7i15gqnPtcVeO4OO7oHzla1b39Eppa3Bd2i13d5XBiT9owLNemUTKOkHzKBlxC6g4fkGvl2q8u0nCmSdmO0HcOXustVmVRq3qufVpshBAgMBAAECggEAUjHG+CeF9qGUtJVxsMN+5sJ0KmWYnT8zWJeMrWrRL4H3upLcw+ma5vqMuxNKWdo8ag+IUC2zeF0yTgNzveIBgqDooyKlp4EZ7d3VJY4frRgft/8wXCFN/cOnTBp+5FKjXQL3tV+IJUZgEdTMlAFA1L1eJ+xx6hVX9bMOJx1c6LhKIGjhj7fxO6wBf8RHNCwi7Y7VgGi5YpW63A2JTQW9PkYTWw4naUHXKHdlGFH5POPRvqdJeL6j54mljFYZBzX1WhAaSEfMqq6rVsugaLQwv3hmzeTG9G4g7Vjt7Y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2wCzFvHJXohtGXtNIIdNMonz5fms4aBU2zCCNhJnH5Gy5kraKngwshaBwQvMIsvN9USvdTkYgTFJVqbC++xJU8z3tLnxvH83n5wLIa+KAEJXZYO3IiNPFSMdoILvJz3iuh058jdp5F6D+TSiSWTbF34yUGRh0uh1H/9/gsnlF4BnOy1S+zEXo0y4RizEmCqL8P1wadQglG+ZZpIp1Uzv3w3DA3BEjIO6KURaABq6ladtG/gE+AtBPBnO4RGewr9VaAt/QBG9Cedox2TMR4BQ71JwIDAQAB";

    // 山东联讯信息技术有限公司
//    public static final String APPID = "2021002140633776";
    // 私钥 pkcs8格式的(山东联讯信息技术有限公司)
//    public static final String RSA_PRIVATE_KEY = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCXxR1z3OlxI+dHhIh4BhgiVoamFwbCTOJ24s2N/ESCKmAyMZ/RVO+6ChLcbfg7Xue+7W1is8z8WsOzDyfWYWwRo/VrB7cU4YNWl91JJOl0ojXf5o8pvZYpsCy4u4cB8rTnMcdmmnsCawkq253lo7zvMIgwDKKMcliR6H7v8ZRbxLeQbMk4ml2cyIhHrhlvTh+9IADPHKommQ9b/4sPMd59mk2kq8i/W8jHbS8SOHa3lVbtxvPtywkE1zAsAG/rEImaYuWUYocimys/s34qrwnvmHPyyGZhCa6eaYNDaLSBRtGfMa1+ZuY4YdQqL8URuEfrS1QIZhoWK6lQk+aFyAu9AgMBAAECggEAYLioSnyQ8R+2dyeJaSRJISkPaq3mCtHAyY9E/KW2a1XiNFrXxSpiFKfy2TPkLMIQ4uag/XQkwPZ/HZAdDUzM+HkLIIisLsyBTSA/UCwL896kguqGdk1yc2LpPVmVcrJgg65/q23r0uCv2PZZLE4rTCwbvrNurB77PxFyRCwrJke8AcF69flZKRdQAYJlr51dmv70pKNzs5r4ZLME32oAAYxqlaXpZvPdiRI1wY4CweDLPpPIAnLJK0PsRFsGJdNMHPcaW6xwy6PDG27MgjH0NmKwsB4o2vMiA8iGmh9yFGEazj0eVvA3aVw6BSELmhnxdjWVDSylgGn/NpzaQ97bKQKBgQDjSjhJmu+b0kYhonxxbaJYKVYRwRGQeZIdrJ9oZAFWKtueQkZFi3NnepEugtBf9zX81TFkQRkst7wKLAG6afbFArM+cgUF32S9K0/rTVT9F1nMaD4ZHsiF/G9c9C92XvCZMgGFoJrJu9XKwrIjfMoABpFlgfyXMrty7x5Up7VLmwKBgQCq8NaOG+41x+hZuDFOQozeJLut1zWTKodBtl3boF860FI3+KMU93CPUF3wrJvB+G9Bx0o9XiXeIJ/ghx2S0asxtM432CVOzhB45ZXldUvjh9JXcxvIcMCLxq02Ef2ghi1hEYFUbTvcMRvWAdWexHkdOEBOAQa51ohtAIdaFerXhwKBgQCtI4WbNEYgOd6okoEfWreXVu20mpEJsEIJDs1jlQKbpAwmEzA6m87uXaSofIfFAqkCj1iPmTNXKCM60GkEmuGbE8J86BhBb/nqTEsV4JPEM/x4xFPBiPyRbElc0row/oNi/3+/Tid7UvW5/fP7Kn0p5dbuL0W926yFEffV3ucwzwKBgFy8X4mk+WxP0WurE4Sjcgyp3O+Ii1YVgl9R8kVOEZu0nIYk60RaoMP/E5eX7MAkaSdEWLBGPUDubg2+/3pBKSDEOAPvzP2dqS4NT262Xb9IVgJ/PhlVof+yfxGQXQoTANdiSclloU3pjnJheGSzrgj+FVS8FcwH6OdJnCRxM4BNAoGAWZrabMxtTI1CKWbBr92WpSTZYZKkUdCgUhoA2YrQukJoZFbXP4vX4BM3eIPtkaoNiC42WzH7wl2I8r8Hx4hiiQhpFLT3irZJoJy56d8OGq380latAK8O+ZWtEAVS11ooykKzrZzlB1KQaS2WZCfYDVR/9rcmyTgU/jrDJXTLfpw=";
    // 支付宝公钥(山东联讯信息技术有限公司)
//    public static final String ALIPAY_PUBLIC_KEY = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAgpUx7Ep188bzx8nkjGUKQLrrrJiUtXD99sqK1GwNtIsImeueWfdqAyBqFZpt4je7CbFB0AjP47d/2qx4tDaITZxfs6kHD+C/f4gMMOTwY/aZ3qKvGlU3eMTN+wLhX3JvpnlnUNo49XMNfJQ026OfBII2A8+tS54CCg5GoCPwgmIt3cBgp9KlyRCYLO61JVx23f9Qu1rl1DTcymnOnVdmf+JhWrxv1siyeLN0GgT0Id7VbXkPObHKwpHEN/0V2cyO+Ifz2LvtJPVRxNnh/kN1PsEVDwnWF0g/4BhtRnwsYStuujggGdrof99ZGSt8umroP5e5D8zFfY2nLfn3PK1TrQIDAQAB";

    // 服务器异步通知页面路径 需http://或者https://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static final String NOTIFY_URL = "/hbapi/v1.0/notify/userOrder/zhiFuBaoCallback";

    // 页面跳转同步通知页面路径 需http://或者https://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问 商户可以自定义同步跳转地址
    public static final String RETURN_URL = "/hbapi/v1.0/notify/userOrder/zhiFuBaoCallback/page";

    // 请求网关地址
    public static final String GATEWAY_URL = "https://openapi.alipay.com/gateway.do";
//    public static String GATEWAY_URL = "https://openapi.alipaydev.com/gateway.do"; // 沙箱模式

    // 编码
    public static final String CHARSET = "UTF-8";

    // 返回格式
    public static final String FORMAT = "json";

    // RSA2
    public static final String SIGN_TYPE = "RSA2";

    public static String notifyUrl() {
        String publicHost = SpringUtil.getProperty("hb.public-host");
        return publicHost + NOTIFY_URL;
    }

    public static String notifyPage() {
        return SpringUtil.getProperty("hb.alipay-notify-page");
    }
}
